-
-
Notifications
You must be signed in to change notification settings - Fork 241
feat: Angular 4.4 support #1002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
uitests |
e2e/renderer/package.json
Outdated
@@ -6,18 +6,18 @@ | |||
"nativescript": { | |||
"id": "org.nativescript.renderer", | |||
"tns-android": { | |||
"version": "next" | |||
"version": "3.2.0-2017-9-12-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope
nativescript-angular/http/ns-http.ts
Outdated
} | ||
|
||
function isLocalRequest(url: string): boolean { | ||
return url.indexOf("~") === 0 || url.indexOf("/") === 0; | ||
return url.indexOf("~") === 0 || url.indexOf("/") === 0; | ||
} | ||
|
||
function normalizeLocalUrl(url: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method can be reused in NsHttpBackEnd
nativescript-angular/http/ns-http.ts
Outdated
reject(responseOptions("Not Found", 404, url)); | ||
} | ||
})); | ||
} | ||
} | ||
|
||
function isLocalRequest(url: string): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicated in NsHttpBackEnd
. May be a good idea to extract it in a common module?
return url; | ||
} | ||
|
||
private handleLocalRequest(url: string): Observable<HttpEvent<any>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the same as _requestLocalUrl
from NSHttp
except the additional error handling for failed parsing. Can we move the method to a common module (with the error handling)?
const json = JSON.parse(data); | ||
observer.next(createSuccessResponse(url, json, 200)); | ||
observer.complete(); | ||
} catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catch only SyntaxError
s?
import { NSFileSystem } from "../file-system/ns-file-system"; | ||
import { NsHttpBackEnd } from "./ns-http-backend"; | ||
|
||
export { NsHttpBackEnd } from "./ns-http-backend"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that reexported from here?
HttpClient, HTTP_INTERCEPTORS, HttpEventType, HttpErrorResponse, | ||
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest | ||
} from "@angular/common/http"; | ||
import { Observable } from "rxjs/observable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from "rxjs/observable"
-> from "rxjs/Observable"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch
e2e |
e2e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove e2e/router/.vscode dir. Rebasing on top of master may resolve that.
return result; | ||
} | ||
|
||
private handleLocalRequest(url: string): Observable<HttpEvent<any>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the method is a bit confusing as it matches the name of the imported function.
nativescript-angular/http/ns-http.ts
Outdated
|
||
function normalizeLocalUrl(url: string): string { | ||
return url.replace("~", "").replace("/", ""); | ||
private handleLocalRequest(url: string): Observable<Response> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
renderer-android |
ERROR Error: Uncaught (in promise): Error: com.tns.NativeScriptException: Failed to find module: "nativescript-angular/value-accessors/base-value-accessor", relative to: app/tns_modules/ Just installed
Narrowed it down to I believe we would get some breaking change all-round. Reverting now until a list is ready. 😄 |
I can see |
|
Hey @jogboms, thanks for reporting that! |
Okay. Didn't notice that. Just sent a PR over. Quick question tho, does v4.4 require the |
Hey @jogboms, |
Very well @vchimev. Thanks. |
|
Nice one. 👍 @vchimev |
In this PR:
[email protected]
NsHttpBackEnd
that handles local requests made withHttpClient
service4.4
updatesResolves #966
Resolves #1001